package com.ruoyi.management.statistical.driversign.service.impl;

import com.ruoyi.management.statistical.driversign.mapper.TDriverSignMapper;
import com.ruoyi.management.statistical.driversign.ro.SaveDriverSignParam;
import com.ruoyi.management.statistical.driversign.service.ITDriverSignService;
import com.ruoyi.management.statistical.driversign.vo.GetDriversVo;
import com.ruoyi.passenger.pay.vo.GetDriverSignVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * 驾驶员打卡信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-12-01
 */
@Service
public class TDriverSignServiceImpl implements ITDriverSignService {
    @Resource
    private TDriverSignMapper tDriverSignMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public GetDriversVo getDrivers(Long companyId) {
        GetDriversVo vo = tDriverSignMapper.getDrivers(companyId);
        return vo;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public GetDriverSignVO getDriverSignVO(String carNo) {
        return tDriverSignMapper.selectDriverSignVO(carNo);
    }

    @Override
    public GetDriverSignVO getDriverSignVoByDriver(String idcard) {
        return tDriverSignMapper.getDriverSignVoByDriver(idcard);
    }

    @Override
    public int save(SaveDriverSignParam param) {
        return tDriverSignMapper.save(param);
    }
}
